package com.demo;

public class MiniDuckSimulator {
    public static void main(String[] args) {
        Duck mallard = new MallardDuck();
        mallard.display();
        mallard.performQuack();
        mallard.performFly();

        System.out.println("\n现在改变它的飞行行为：");

        // 动态改变行为（策略模式的亮点）
        mallard.setFlyBehavior(new FlyNoWay());
        mallard.performFly();
    }
}
